package com.dxl.consumer.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Description: 主题模式
 *
 * @author: Yingyu Wei
 * <p>File Created at 2021/5/7</p>
 */
@Component
public class FullLogConsumer {


    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("${topic.full.queue}"), //
            key = {"*.full.*"},
            exchange = @Exchange(name = "${mqlog.topic}", type = ExchangeTypes.TOPIC)
    ))
    public void handlerMessage(String msg) {
        System.out.println("full===>s收到的消息：" + msg);
    }

}
